﻿namespace PerpheralDevice.IRepository;

public interface IPerpDevRepository {
    /// <summary>
    /// 获取对应外设类型的外设列表
    /// </summary>
    /// <typeparam name="T">外设对象类型</typeparam>
    /// <returns>外设列表</returns>
    IEnumerable<T> GetAll<T>() where T : PerpDev;
    /// <summary>
    /// 根据外设ID获取外设对象
    /// </summary>
    /// <typeparam name="T">外设对象类型</typeparam>
    /// <param name="devID">外设ID</param>
    /// <returns>外设对象</returns>
    T GetByID<T>(string devID) where T : PerpDev;
    /// <summary>
    /// 更新外设并持久化其配置参数
    /// </summary>
    /// <param name="perpDevConfig">外设配置参数</param>
    /// <returns></returns>
    T Update<T>(IPerpDevConfig perpDevConfig) where T : PerpDev;
}
